package es.cea.listener;

import java.util.ArrayList;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * Application Lifecycle Listener implementation class IniciaListaContexto
 *
 */
@WebListener
public class IniciaListaContexto implements ServletContextListener {

    /**
     * Default constructor. 
     */
    public IniciaListaContexto() {
        // TODO Auto-generated constructor stub
    }

	/**
     * @see ServletContextListener#contextInitialized(ServletContextEvent)
     */
    public void contextInitialized(ServletContextEvent arg0) {
        
    	ServletContext servletContext = arg0.getServletContext();
		
		Object source = arg0.getSource();
		ArrayList<Integer> listaEstadisticas = new ArrayList <Integer>();
		
		listaEstadisticas.add(new Integer(1));
		
		servletContext.setAttribute("estadisticasApp",listaEstadisticas);
    }

	/**
     * @see ServletContextListener#contextDestroyed(ServletContextEvent)
     */
    public void contextDestroyed(ServletContextEvent arg0) {
        // TODO Auto-generated method stub
    }
	
}
